(* Content-type: application/mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 7.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       145,          7]
NotebookDataLength[     15213,        408]
NotebookOptionsPosition[     13714,        354]
NotebookOutlinePosition[     14252,        377]
CellTagsIndexPosition[     14167,        372]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
   "use", " ", "this", " ", "notebook", " ", "to", " ", "generate", " ", 
    "fitted", " ", "Cole", " ", "parameters"}], "*)"}], "\[IndentingNewLine]",
   "\[IndentingNewLine]"}]], "Input",
 CellChangeTimes->{{3.478562507484375*^9, 3.478562516828125*^9}, {
   3.478562787*^9, 3.478562800109375*^9}, 3.478562961671875*^9, {
   3.478582153015625*^9, 3.4785821655625*^9}, {3.5069341515625*^9, 
   3.50693416884375*^9}, 3.506934223390625*^9, 3.506934476859375*^9, 
   3.5069369901875*^9, {3.507025493484375*^9, 3.50702550025*^9}, 
   3.50709595896875*^9, 3.50710650090625*^9}],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.507095960046875*^9, 3.507095960046875*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"Begin", "[", "\"\<W`features`\>\"", "]"}], ";", 
    "\[IndentingNewLine]", 
    RowBox[{"Clear", "[", "\"\<W`features`*\>\"", "]"}], ";"}], "*)"}], 
  "\[IndentingNewLine]"}]], "Input",
 CellChangeTimes->{{3.478562507484375*^9, 3.478562516828125*^9}, {
   3.478562787*^9, 3.478562800109375*^9}, 3.478562961671875*^9, {
   3.478582153015625*^9, 3.4785821655625*^9}, {3.5069341515625*^9, 
   3.50693421578125*^9}, {3.50693434096875*^9, 3.5069343506875*^9}, 
   3.507095994265625*^9, {3.507105975046875*^9, 3.5071060020625*^9}, 
   3.50710649875*^9}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"<<", "Data`"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"Names", "[", "\"\<W`Data`*\>\"", "]"}]}], "Input",
 CellChangeTimes->{{3.50693714321875*^9, 3.506937181671875*^9}, 
   3.50702561284375*^9, {3.50702567290625*^9, 3.5070256738125*^9}, {
   3.50709600184375*^9, 3.507096009296875*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"\<\"ccData\"\>", ",", "\<\"ColeData\"\>", ",", "\<\"Freq\"\>", 
   ",", "\<\"mData\"\>", ",", "\<\"xyData\"\>"}], "}"}]], "Output",
 CellChangeTimes->{{3.50702559415625*^9, 3.507025614296875*^9}, 
   3.50702567465625*^9, {3.507095997328125*^9, 3.50709601028125*^9}, 
   3.507096430078125*^9, 3.50709661590625*^9, 3.507096689765625*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"data", "=", 
   RowBox[{"mData", "[", "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.50693723196875*^9, 3.506937241*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"<<", "BISfit`"}], "\[IndentingNewLine]", 
 RowBox[{"Names", "[", "\"\<BISfit`*\>\"", "]"}]}], "Input",
 CellChangeTimes->{{3.478562507484375*^9, 3.478562516828125*^9}, {
   3.478562787*^9, 3.478562800109375*^9}, 3.478562961671875*^9, {
   3.478582153015625*^9, 3.4785821655625*^9}, {3.5069341515625*^9, 
   3.506934195484375*^9}, 3.506937326859375*^9, 3.507025624625*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"\<\"BISffit\"\>", ",", "\<\"BISLSfit\"\>", ",", "\<\"ColeP\"\>", 
   ",", "\<\"Filterd\"\>", ",", "\<\"Maxd\"\>", ",", "\<\"Mind\"\>"}], 
  "}"}]], "Output",
 CellChangeTimes->{{3.478562488328125*^9, 3.478562518328125*^9}, {
   3.478562590296875*^9, 3.478562598046875*^9}, 3.478562629703125*^9, 
   3.478562800921875*^9, {3.478562860765625*^9, 3.478562886609375*^9}, 
   3.478562927625*^9, 3.4785629625625*^9, 3.478563003375*^9, 
   3.4785769721875*^9, 3.4785770495*^9, 3.478577190015625*^9, {
   3.47857724334375*^9, 3.478577327546875*^9}, 3.478582175109375*^9, 
   3.47961562034375*^9, 3.47961601371875*^9, 3.47961633953125*^9, 
   3.4797042074296036`*^9, 3.4797043153514786`*^9, 3.4797043469139786`*^9, 
   3.50693425334375*^9, 3.50693721128125*^9, 3.50693725828125*^9, {
   3.506937319375*^9, 3.50693732915625*^9}, 3.506937402421875*^9, 
   3.506937911859375*^9, 3.506937952375*^9, 3.50693829240625*^9, 
   3.5069383571875*^9, 3.50693839184375*^9, 3.50693883765625*^9, {
   3.50693889390625*^9, 3.50693891375*^9}, {3.50702561959375*^9, 
   3.507025625640625*^9}, 3.507096804640625*^9, 3.50710348646875*^9, 
   3.5071040108125*^9, 3.50710943015625*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
   RowBox[{"data", "//", "MatrixForm"}], ";", "\[IndentingNewLine]", 
   RowBox[{"d", "=", 
    RowBox[{"Length", "[", 
     RowBox[{"data", "[", 
      RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{"EvenQ", "[", "d", "]"}], "\[IndentingNewLine]", "d"}], "=", 
    RowBox[{"d", "/", "2"}]}]}], "*)"}]], "Input",
 CellChangeTimes->{{3.47961604175*^9, 3.479616042234375*^9}, {
   3.4796160866875*^9, 3.47961609059375*^9}, {3.479616122109375*^9, 
   3.479616133234375*^9}, {3.479616215765625*^9, 3.479616247390625*^9}, 
   3.479616383953125*^9, {3.47961732271875*^9, 3.47961732578125*^9}, 
   3.5069342963125*^9}],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{"abc", "=", 
   RowBox[{
    RowBox[{
     RowBox[{"data", "[", 
      RowBox[{"[", "1", "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"All", ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], "\[IndentingNewLine]", 
    RowBox[{"ColeP", "[", "abc", "]"}]}]}], "*)"}]], "Input",
 CellChangeTimes->{{3.506937722140625*^9, 3.5069377508125*^9}, {
   3.50693780478125*^9, 3.50693783403125*^9}, {3.506937965125*^9, 
   3.506937999265625*^9}, 3.506938942515625*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
   RowBox[{"BISffit", "[", 
    RowBox[{
     RowBox[{"data", "[", 
      RowBox[{"[", "1", "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"All", ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "4"}], "}"}]}], "]"}], "]"}], "]"}], 
   "\[IndentingNewLine]", 
   RowBox[{"BISLSfit", "[", 
    RowBox[{
     RowBox[{"data", "[", 
      RowBox[{"[", "1", "]"}], "]"}], "[", 
     RowBox[{"[", 
      RowBox[{"All", ",", 
       RowBox[{"{", 
        RowBox[{"3", ",", "4"}], "}"}]}], "]"}], "]"}], "]"}]}], 
  "*)"}]], "Input",
 CellChangeTimes->{{3.506937722140625*^9, 3.5069377508125*^9}, {
   3.50693780478125*^9, 3.50693783403125*^9}, {3.506937965125*^9, 
   3.506937967484375*^9}, {3.506938303*^9, 3.50693830428125*^9}, 
   3.506938938828125*^9, {3.507025704296875*^9, 3.50702573259375*^9}, {
   3.507025880890625*^9, 3.507025898078125*^9}, 3.507103609703125*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"59.68860688710968`", ",", 
   RowBox[{"-", "7.741046298167971`"}], ",", "21.176401566345803`"}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.506937741296875*^9, {3.506937795828125*^9, 3.506937835375*^9}, 
   3.506937913609375*^9, 3.506937954921875*^9, 3.50693831746875*^9, {
   3.506938359890625*^9, 3.50693839340625*^9}, 3.506938842578125*^9, {
   3.50693890221875*^9, 3.50693891640625*^9}, {3.507025734375*^9, 
   3.507025737515625*^9}, {3.507025886859375*^9, 3.50702589859375*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"59.68860688710969`", ",", 
   RowBox[{"-", "7.741046298168661`"}], ",", "21.17640156634635`"}], 
  "}"}]], "Output",
 CellChangeTimes->{
  3.506937741296875*^9, {3.506937795828125*^9, 3.506937835375*^9}, 
   3.506937913609375*^9, 3.506937954921875*^9, 3.50693831746875*^9, {
   3.506938359890625*^9, 3.50693839340625*^9}, 3.506938842578125*^9, {
   3.50693890221875*^9, 3.50693891640625*^9}, {3.507025734375*^9, 
   3.507025737515625*^9}, {3.507025886859375*^9, 3.50702589865625*^9}}]
}, Open  ]],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{
   RowBox[{"pr", "//", 
    RowBox[{"MatrixForm", "\[IndentingNewLine]", 
     RowBox[{"Export", "[", 
      RowBox[{"\"\<ca_50.txt\>\"", ",", "pr", ",", "\"\<Table\>\""}], 
      "]"}]}]}], ";"}], "*)"}]], "Input",
 CellChangeTimes->{{3.47961653653125*^9, 3.47961654178125*^9}, {
   3.47961669865625*^9, 3.479616737203125*^9}, {3.47961689765625*^9, 
   3.47961689959375*^9}, {3.47961693375*^9, 3.47961698109375*^9}, {
   3.479617262953125*^9, 3.479617264046875*^9}, 3.479617792703125*^9, {
   3.47961980103125*^9, 3.47961980571875*^9}, {3.479620190984375*^9, 
   3.479620213578125*^9}, 3.506934275015625*^9}],

Cell[BoxData[
 RowBox[{"(*", 
  RowBox[{"{", 
   RowBox[{
    RowBox[{"Mean", "[", "pr", "]"}], ",", 
    RowBox[{
     RowBox[{"Variance", "[", "pr", "]"}], "/", 
     RowBox[{"Mean", "[", "pr", "]"}]}]}], "}"}], "*)"}]], "Input",
 CellChangeTimes->{{3.47961653653125*^9, 3.47961654178125*^9}, {
   3.47961669865625*^9, 3.479616737203125*^9}, {3.47961689765625*^9, 
   3.47961689959375*^9}, {3.47961693375*^9, 3.47961698109375*^9}, {
   3.479617262953125*^9, 3.479617264046875*^9}, 3.479617792703125*^9, {
   3.47961980103125*^9, 3.47961980571875*^9}, {3.479620190984375*^9, 
   3.479620213578125*^9}, {3.4796205111875*^9, 3.4796205201875*^9}, 
   3.506934277953125*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Dimensions", "[", "data", "]"}]], "Input",
 CellChangeTimes->{{3.506934305765625*^9, 3.506934337390625*^9}, {
  3.5069376654375*^9, 3.506937668921875*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"32", ",", "32", ",", "16"}], "}"}]], "Output",
 CellChangeTimes->{3.506937669765625*^9, 3.50702563375*^9, 
  3.50709644503125*^9, 3.507105792609375*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"f", "=", 
   RowBox[{"Freq", "[", "]"}]}], ";"}]], "Input"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"dt", "=", 
   RowBox[{"Reap", "[", 
    RowBox[{"For", "[", 
     RowBox[{
      RowBox[{"i", "=", "1"}], ",", 
      RowBox[{"i", "\[LessEqual]", 
       RowBox[{"Length", "[", "data", "]"}]}], ",", 
      RowBox[{"i", "++"}], ",", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"dd", "=", 
        RowBox[{"data", "[", 
         RowBox[{"[", "i", "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
       "\[IndentingNewLine]", 
       RowBox[{"d", "=", 
        RowBox[{"Length", "[", 
         RowBox[{"dd", "[", 
          RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"Not", " ", 
          RowBox[{"EvenQ", "[", "d", "]"}]}], ",", 
         RowBox[{
          RowBox[{"Continue", "[", "]"}], ";"}]}], "]"}], ";", 
       RowBox[{"(*", 
        RowBox[{"it", " ", "should", " ", "never", " ", "be", " ", "odd"}], 
        "*)"}], "\[IndentingNewLine]", 
       RowBox[{"d", "=", 
        RowBox[{"d", "/", "2"}]}], ";", "\[IndentingNewLine]", 
       RowBox[{"Sow", "[", 
        RowBox[{"pr", "=", 
         RowBox[{"Table", "[", 
          RowBox[{
           RowBox[{"ColeP", "[", 
            RowBox[{
             RowBox[{"dd", "[", 
              RowBox[{"[", 
               RowBox[{"All", ",", 
                RowBox[{"{", 
                 RowBox[{
                  RowBox[{
                   RowBox[{"2", " ", "j"}], "-", "1"}], ",", 
                  RowBox[{"2", " ", "j"}]}], "}"}]}], "]"}], "]"}], ",", 
             "f"}], "]"}], ",", 
           RowBox[{"{", 
            RowBox[{"j", ",", "d"}], "}"}]}], "]"}]}], "]"}], ";", 
       "\[IndentingNewLine]", "\[IndentingNewLine]", 
       RowBox[{"Export", "[", 
        RowBox[{
         RowBox[{"\"\<ca_\>\"", "<>", 
          RowBox[{"ToString", "[", 
           RowBox[{"i", "+", "49"}], "]"}], "<>", "\"\<.dat\>\""}], ",", "pr",
          ",", "\"\<Table\>\""}], "]"}], ";"}]}], "\[IndentingNewLine]", 
     "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"ColeData", "=", 
     RowBox[{"dt", "[", 
      RowBox[{"[", 
       RowBox[{"2", ",", "1"}], "]"}], "]"}]}], ";"}], "*)"}]}]}], "Input",
 CellChangeTimes->{
  3.47963149709375*^9, {3.47963355575*^9, 3.47963356625*^9}, {
   3.479633658984375*^9, 3.479633659515625*^9}, {3.479633756265625*^9, 
   3.47963376159375*^9}, {3.4796339948125*^9, 3.479634099921875*^9}, {
   3.479634143171875*^9, 3.47963414334375*^9}, {3.479685853671875*^9, 
   3.479685947859375*^9}, {3.47968603375*^9, 3.479686033859375*^9}, {
   3.4797037421171036`*^9, 3.4797038682577286`*^9}, {3.4797042816483536`*^9, 
   3.4797043076014786`*^9}, {3.4797043396796036`*^9, 3.4797043410233536`*^9}, 
   3.5069343299375*^9, {3.506934362765625*^9, 3.506934395203125*^9}, {
   3.506934438953125*^9, 3.50693445071875*^9}, {3.506934522796875*^9, 
   3.50693457575*^9}, {3.506937621265625*^9, 3.506937627046875*^9}, {
   3.506937677875*^9, 3.5069376803125*^9}, {3.506939283359375*^9, 
   3.506939285859375*^9}, 3.5070256958125*^9, 3.50702580775*^9, {
   3.507103637546875*^9, 3.507103652921875*^9}, {3.507105754125*^9, 
   3.50710577221875*^9}, {3.507105852875*^9, 3.507105885828125*^9}, {
   3.50717872303125*^9, 3.5071787235*^9}}],

Cell[BoxData[""], "Input",
 CellChangeTimes->{{3.5070258181875*^9, 3.50702583259375*^9}, 
   3.50709602465625*^9, 3.50710362434375*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"?", "ColeP"}]], "Input",
 CellChangeTimes->{{3.507103739296875*^9, 3.507103746515625*^9}, {
  3.50710382965625*^9, 3.50710383184375*^9}, {3.507103867*^9, 
  3.507103883328125*^9}, {3.507103921125*^9, 3.50710392125*^9}, {
  3.50710401446875*^9, 3.507104014640625*^9}, {3.507109420265625*^9, 
  3.507109422375*^9}}],

Cell[BoxData[
 StyleBox["\<\"get the resistances(r0,r\[Infinity],\[Alpha])\"\>", 
  "MSG"]], "Print", "PrintUsage",
 CellChangeTimes->{3.507109432328125*^9},
 CellTags->"Info3507138232-9439829"]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"End", "[", "]"}], ";"}], "*)"}], "\n"}]], "Input",
 CellChangeTimes->{{3.507096091046875*^9, 3.507096094671875*^9}}]
},
WindowSize->{954, 719},
WindowMargins->{{91, Automatic}, {Automatic, 15}},
ShowSelection->True,
CellContext->"W`",
FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (November 10, 2008)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "Info3507138232-9439829"->{
  Cell[13319, 340, 194, 4, 45, "Print",
   CellTags->"Info3507138232-9439829"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"Info3507138232-9439829", 14063, 366}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[545, 20, 626, 12, 94, "Input"],
Cell[1174, 34, 92, 1, 39, "Input"],
Cell[1269, 37, 614, 13, 94, "Input"],
Cell[CellGroupData[{
Cell[1908, 54, 325, 6, 67, "Input"],
Cell[2236, 62, 375, 6, 38, "Output"]
}, Open  ]],
Cell[2626, 71, 157, 4, 39, "Input"],
Cell[CellGroupData[{
Cell[2808, 79, 396, 6, 67, "Input"],
Cell[3207, 87, 1195, 19, 38, "Output"]
}, Open  ]],
Cell[4417, 109, 713, 16, 121, "Input"],
Cell[5133, 127, 538, 14, 67, "Input"],
Cell[CellGroupData[{
Cell[5696, 145, 917, 25, 67, "Input"],
Cell[6616, 172, 525, 10, 38, "Output"],
Cell[7144, 184, 524, 10, 38, "Output"]
}, Open  ]],
Cell[7683, 197, 650, 13, 67, "Input"],
Cell[8336, 212, 671, 14, 39, "Input"],
Cell[CellGroupData[{
Cell[9032, 230, 179, 3, 39, "Input"],
Cell[9214, 235, 192, 4, 38, "Output"]
}, Open  ]],
Cell[9421, 242, 94, 3, 39, "Input"],
Cell[9518, 247, 3298, 77, 310, "Input"],
Cell[12819, 326, 135, 2, 39, "Input"],
Cell[CellGroupData[{
Cell[12979, 332, 337, 6, 39, "Input"],
Cell[13319, 340, 194, 4, 45, "Print",
 CellTags->"Info3507138232-9439829"]
}, Open  ]],
Cell[13528, 347, 182, 5, 67, "Input"]
}
]
*)

(* End of internal cache information *)
